#pragma once

#include <cftc/reflect/object.h>
#include <cftf/meta/table.h>
#include "metadata/creatureinfo.h"

namespace mt
{

    class CreatureData : public cftc::reflect::Object, public cftf::meta::Table<CreatureData, unsigned int>
    {
        CFT_DECLARE_REFLECT_CLASS();
    public:
        unsigned int guid = 0;
        unsigned int id = 0;                                              // entry in creature_template
        unsigned short mapid;
        unsigned int modelid_override = 0;                                // overrides any model defined in creature_template
        int equipmentId = 0;
        float posX = 0.0f;
        float posY = 0.0f;
        float posZ = 0.0f;
        float orientation = 0.0f;
        unsigned int spawntimesecs = 0;
        float spawndist = 0;
        unsigned int currentwaypoint = 0;
        unsigned int curhealth = 0;
        unsigned int curmana = 0;
#if 1
        int  is_dead = 0;
#else
        bool  is_dead = false;
#endif
        unsigned char movementType = 0;

        ObjectGuid GetObjectGuid(unsigned int lowguid) const
        {
            return ObjectGuid(CreatureInfo::GetHighGuid(), id, lowguid);
        }

        inline static std::multimap<unsigned int, unsigned int> active_creature_guids_onmap_;

        void MetaInstanceInit1();
    private:
        unsigned int gameEvent = 0;
        unsigned int GuidPoolId = 0;
        unsigned int EntryPoolId = 0;

    };

}

